<script>
    var showedAlert = false;
    function handleUnload()
    {
        if (showedAlert)
            return;

        showedAlert = true;
        alert("Now Quit Safari. Do not dismiss this alert first.");
    }
</script>
<body onunload="handleUnload()">
    Close this window
</body>
